Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Assign.js - dependency-free very minimal assign function
========
Assign.js is an extremely tiny helper function to assign objects
Command line:
npm install assign.js --save
In JS code:
var assigner = require('assign.js');
...
assigner.assign( obj1, obj2[, obj3[, objN]] );
Respect will force assignment if property already exist
assigner.validvalues( true )
Assign.js will set only non 'null'-like values from source object. False by default.
assigner.respect( true )
Assign.js will respect the already existing non-empty values of keys. False by default.
assigner.recursive( true )
Tells assigner to walk recursively when assigning objects. Yes by default.
assigner.attributes( [] )
Defines the list of keys allowed to be assigned.
assigner.attributes( [] )
Defines the list of keys excluded to be assigned.
assigner.primitives( [] )
Defines the list of keys considered as values to be assigned preventing to recursively processed.
assigner.blueprinting( true )
If it is set to 'true', Assign.js will consider the keyset of the destination object as reference otherwise key-set will be read from the object assigned from.
assigner.forceful( true )
This option will follow the path of the source object eventually overwriting the one found in the dest object.
assigner.pick(object, properties)
This will project the object into a new object possessing the properties defined by the 2nd parameter which might be given as array or varargs as well.
assigner.cloneObject( source )
This created a cloned object from the source copied recursively.
assigner.mask( source, mask )
This created an object with the references only allowed by the mask object.
assigner.purify( source, mask )
This created an object with the references only not denifed by the mask object.
FAQs
Tiny libary to assign objects
We found that assign.js demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.